package com.example.pwj.ffstudy.comm;

import android.app.Application;
import android.content.Context;

import com.example.pwj.ffstudy.util.ActivityScoped;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by pwj on 2017/8/23.
 */

@Module
public class AppModule {
    private Context context;

    public AppModule(Context context) {
        this.context = context;
    }

    @Singleton
    @Provides
    Context provideContext() {
        return context;
    }

    @Singleton
    @Provides
    MyApp provideApp() {
        return (MyApp)context.getApplicationContext();
    }
}
